import 'package:cream_chat_flutter/pages/MyDetails/MyDetails.dart';
import 'package:cream_chat_flutter/pages/Test/Test.dart';
import 'package:cream_chat_flutter/pages/UserDetails/UserDetails.dart';
import 'package:flutter/material.dart';
import 'package:cream_chat_flutter/pages/IndexPage/IndexPage.dart';

import 'BottomNavigator.dart';

enum Routes { test, bottomNavigator,indexPage, myDetails, userDetails}

Page<dynamic> getPage(Routes routes) {
  String name = routes.toString();
  switch (routes) {
    case Routes.test:
      return Test(key: ValueKey(name), name: name);
    case Routes.bottomNavigator:
      return BottomNavigator(key: ValueKey(name), name: name);
    case Routes.indexPage:
      return IndexPage(key: ValueKey(name), name: name);
    case Routes.myDetails:
      return MyDetails(key: ValueKey(name), name: name);
    case Routes.userDetails:
      return UserDetails(key: ValueKey(name), name: name);
    default:
      return IndexPage(key: ValueKey(name), name: name);
  }
}